package com.iot.iotplus.entity;

import com.aliyun.core.annotation.Body;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;
import java.util.List;

@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
@TableName("qf_area")
public class Area {
    private Integer code;
    private String name;
    private Integer level;
    private String type;
    private String abname;
    private Integer pid;
    private String pname;
    private String note;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @TableField(exist = false)
    private List<Area> areas;

    public Area(Integer code, String name, Integer level, String type, String abname, Integer pid, String pname, String note, Date createTime, Date updateTime) {
        this.code = code;
        this.name = name;
        this.level = level;
        this.type = type;
        this.abname = abname;
        this.pid = pid;
        this.pname = pname;
        this.note = note;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
}
